package Effects.Buffs;

import Effects.Effect;
import Entities.RPGEntity;
import Statistics.*;

public class HPIncrease extends Buff
{
	private static final String BUFF_NAME = "HP Increase";
	
	/**
	 * Constructor
	 * @param power
	 * @param host
	 */
	public HPIncrease(double power)
	{
		super(BUFF_NAME, power, Effect.BUFF_HP_INCREASE, false);
	}

	@Override
	public void applyEffect()
	{
		//Making sure the same buff can't be applied twice.
		if(!applied && host != null)
		{
			this.host.increaseStat(Statistics.STAT_HP_MAX, power);
			this.applied = true;
		}
	}

	@Override
	public void removeEffect()
	{
		//Making sure the buff can't be removed if it is already applied.
		if(applied && host != null)
		{
			this.host.decreaseStat(Statistics.STAT_HP_MAX, power);
			this.applied = false;
		}
	}
}